﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Reflection;
using System.Web.Mvc;
using tracker.Models.BLL;
using tracker.Models;
namespace tracker.Controllers
{
    public class CallAjaxFilter : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            HttpContext ctx = HttpContext.Current;

            if (ctx.Session[Common.USER] == null)
            {
               // ctx.Response.Redirect("/Home/Fail");
                ctx.Response.Status = "301 Moved Permanently";
                ctx.Response.StatusCode = 301;
                ctx.Response.AddHeader("Location", "http://www.thenewdomain.com");
            }

            base.OnActionExecuting(filterContext);

        }
    }
}
